home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / rexx / rxview.lha / viewer.rexx < prev   
OS/2 REXX Batch file  |  1994-12-10  |  2KB  |  63 lines

  1. /* $Revision Header built automatically *************** (do not edit) ************
  2. **
  3. ** © Copyright by Binary Dreams
  4. **
  5. ** File             : viewer.rexx
  6. ** Created on       : Thursday, 10.11.94 00:55:28
  7. ** Created by       : Fabrizio Lodi
  8. ** Current revision : V1.0
  9. **
  10. **
  11. ** Purpose
  12. ** -------
  13. **     Make actions on filetype.
  14. **     Identify the filetype on extension.
  15. **
  16. ** Revision V1.0
  17. ** --------------
  18. ** created on Saturday, 10.12.94 08:48:34  by  Fabrizio Lodi.   LogMessage :
  19. **   - Now I wanna know if someone like the idea
  20. **
  21. ** Revision V0.2
  22. ** --------------
  23. ** created on Saturday, 10.12.94 08:46:29  by  Fabrizio Lodi.   LogMessage :
  24. **   - Some comment :-) added
  25. **     Now is more simply to understand
  26. **
  27. ** Revision V0.1
  28. ** --------------
  29. ** created on Thursday, 10.11.94 00:55:28  by  Fabrizio Lodi.   LogMessage :
  30. **     --- Initial release ---
  31. **
  32. *********************************************************************************/
  33.  
  34. /*
  35.     Here we get the file name from the command line
  36. */
  37. arg filename
  38.  
  39. /*
  40.     An then we extract the file extension, ie the chars after the last '.'
  41. */
  42. ext=''
  43. if lastpos(".",filename)~==0 then ext=right(filename,length(filename)-lastpos(".",filename),lastpos(".",filename))
  44.  
  45. /*
  46.     Finally we run the needed command line for an extension or a single file
  47. */
  48. select
  49.     when filename=='READ.ME' then address command 'tr '||filename
  50.     when ext=='DOC' then address command 'tr '||filename
  51.     when ext=='TXT' then address command 'tr '||filename
  52.     when ext=='IFF' then address command 'fastview '||filename
  53.     when ext=='GIF' then address command 'fastview '||filename
  54.     when ext=='PIC' then address command 'fastview '||filename
  55.     when ext=='JPG' then address command 'fastjpeg '||filename
  56.     when ext=='JPEG' then address command 'fastjpeg '||filename
  57.     when ext=='INFO' then address command 'wbinfo '||filename
  58.     when ext=='GUIDE' then address command 'multiview '||filename
  59.     when ext=='LHA' then address command 'pk:lha l '||filename||' >con:0/0/500/200/LHA/CLOSE/WAIT'
  60.     otherwise address command 'multiview '||filename
  61. end
  62.  
  63.